<?php

$param = $_POST;
$aes = new \lib\AES($param["key"], $param["iv"]);
$res = "";
switch ($param["type"]) {
    case "encrypt":
        $res = $aes->encrypt($param["data"]);
        break;
    case "decrypt":
        $res = $aes->decrypt($param["data"]);
        break;
}

response($res);